import { http } from "@/utils/http";

// 获取培训配置列表
export const getTrainConfigListAPI = data => {
  return http.request("post", "/dms/api/v1/training/listPage", {
    data
  });
};

// 保存培训基本信息
export const saveTrainBasicAPI = data => {
  return http.request("post", "/dms/api/v1/training/saveTrainingBase", {
    data
  });
};

// 获取角色关联的用户
export const getRoleUserAPI = data => {
  return http.request("post", "/account/user/listPage", {
    data
  });
};

// 删除培训配置
export const deleteTrainConfigAPI = data => {
  return http.request("post", "/dms/api/v1/training/delete", {
    data
  });
};

// 发布
export const publishAPI = data => {
  return http.request("post", "/dms/api/v1/training/publish", {
    data
  });
};

// 下架
export const offShelfAPI = data => {
  return http.request("post", "/dms/api/v1/training/unshelve", {
    data
  });
};

// 获取我的培训列表
export const getMyTrainListAPI = data => {
  return http.request("post", "/dms/api/v1/training/listMyTraining", {
    data
  });
};

// 获取培训课程文件
export const getCourseFileAPI = data => {
  return http.request("post", "/dms/api/v1/training/viewFile", {
    data
  });
};

// 获取培训明细列表
export const getDetailListAPI = data => {
  return http.request("post", "/dms/api/v1/training/listTrainingDetail", {
    data
  });
};

// 获取培训总览列表
export const getOverViewListAPI = data => {
  return http.request("post", "/dms/api/v1/training/listTrainingSummary", {
    data
  });
};

// 保存培训配置
export const saveConfigAPI = data => {
  return http.request("post", "/dms/api/v1/training/addTraining", {
    data
  });
};

// 编辑前查询
export const editSearchAPI = data => {
  return http.request("post", "/dms/api/v1/training/viewTraining", {
    data
  });
};

// 保存培训进度
export const saveProgressAPI = data => {
  return http.request("post", "/dms/api/v1/training/addTrainState", {
    data
  });
};

// 获取考试下拉框数据
export const getExamListAPI = data => {
  return http.request("post", "/dms/api/v1/exam/trainingExamine", {
    data
  });
};

// 判断是否可以考试
export const canExamAPI = data => {
  return http.request("post", "/dms/api/v1/training/wasInExam", {
    data
  });
};

// 根据组织获取人员
export const getPeopleByDeptAPI = data => {
  return http.request("post", "/account/api/v1/user/listPage", {
    data
  });
};

// 培训单独管理考生
export const saveTraineeAPI = data => {
  return http.request("post", "/dms/api/v1/training/saveTrainee", {
    data
  });
};
